﻿<UserControl x:Class="ConsoleHoster.View.Controls.ContentSearchPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:uc="clr-namespace:ConsoleHoster.View.Controls"
             mc:Ignorable="d" d:DesignWidth="506" d:DesignHeight="27" >
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </UserControl.Resources>
    <UserControl.Visibility>
        <Binding Converter="{StaticResource BooleanToVisibilityConverter}" Path="SearchEnabled"/>
    </UserControl.Visibility>
    <Border Background="#FFE8E8E8" x:Name="pnlFind" BorderBrush="DarkGray" BorderThickness="1, 0, 1, 1" HorizontalAlignment="Stretch" MinHeight="26">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal">
                <uc:TabCloseButton VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="3, 0, 0, 0" Width="16" Height="16" BorderThickness="0" BorderBrush="Transparent" Command="{Binding Path=CloseSearchCommand}" Cursor="Hand" />
                <TextBlock Text="Find:" VerticalAlignment="Center" Margin="3, 0, 0, 0" />
            </StackPanel>
            <TextBox VerticalAlignment="Center" MaxLength="255" Margin="3, 0, 0, 0" Text="{Binding Path=TextToFind, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" x:Name="txbSearch" PreviewKeyDown="txbSearch_PreviewKeyDown" Grid.Column="1" />
            <StackPanel Grid.Column="2" Orientation="Horizontal" Margin="3, 0, 0, 0">
                <TextBlock Text="Found: 0" VerticalAlignment="Center" Visibility="Collapsed" />
                <Button Content="Previous" Margin="3, 0, 0, 0" VerticalAlignment="Center" Visibility="Collapsed"/>
                <Button Content="Next" Margin="3, 0, 3, 0" VerticalAlignment="Center" Command="{Binding Path=FindNextCommand}" Cursor="Hand" Padding="5, 0, 5, 0"/>
            </StackPanel>
        </Grid>
    </Border>
</UserControl>
